package java虚拟机.chapter7;

/**
 * @author juntao zhang
 */
public class FieldResolution {

  interface Interface0 {

    int A = 0;

  }

  interface Interface1 extends Interface0 {

    int A = 1;
  }

  interface Interface2 {
    default void fun(){
      System.out.println("Interface2");
    }
    int A = 2;
  }

  static class Parent implements Interface1 {
    public void fun(){ // prior to interface
      System.out.println("Parent");
    }

    public static int A = 3;
  }

  static class Sub extends Parent implements Interface2 {

    public static int A = 4;
  }

  public static void main(String[] args) {
    System.out.println(Sub.A);
    new Sub().fun();
  }
}
